
.TH  COREWAR 1 "Mar 21, 2010" "Version 1.0" "COREWAR Manual"
.SH NAME
.B COREWAR - Virtual machine where champions (.cor files) can be run for fighting in a safe memory space.
.SH SYNOPSIS
.B ./corewar \fR[\fIOPTIONS\fR] [[[\fIFILE_OPTIONS\fR] \fIFILE.cor\fR] ... | \fIFOLDER\fR]
.SH DESCRIPTION
\fBCorewar\fP is a virtual machine which sets (6 Kbytes * nb_player) of safe memory. Then, corewar execute each instruction of champions on a specific number of cycles.
All champions must say "live" to survive in this memory area, the last who execute the instruction live for himself wins the game.

If you put a folder in parameter, it will launch a selector (my_select) to choose files you want in this folder.
If you put no directory and no .cor files, it will also launch the selector to choose files you want in the current folder.
If you put no directory and no .cor files but a -tournament, it will take all .cor files in the internal default folder and launch the tournament.
You can also put champions as this example : ./corewar player1.cor player2.cor player3.cor, etc.

The file selector can also compile assembler file. You just have to select .s files as .cor file, and the virtual machine will automatically compile it.

During the first 7518 cycles, the champion cannot leave his own memory area.
.SH OPTIONS
The following options are supported:
.TP
\fB-gui\fP
.B GUI mode,\
\fR sets a graphical representation of the fight. Make sure you have the libx installed on your computer.\f
.TP
\fB-tournament <players_by_round>\fP
.B Tournament mode,\
\fR champions are put in groups. Then, they begin fight with specified players by round number's until the final match, which will determinate the best of the best.
If this option is set, and there is not folder stated, corewar will take a default folder for the tournament who contains your champions. If there is a folder specified it will launch a selector(my_select) to choose files you want.
.TP
\fB-v\fP
.B Verbose mode, \

\f Print what programs do, during the game.\f
.TP
\fB-unblock\fP
\f The virtual machine will not stop executing champions until they're all dead. By default, fights are stopped when only one champion is still alive and that he's the current winner.\f
\f This option allows you to test a champion in a empty environment, in order to see what he does.\f
.TP
\fB-variant\fP
\f This option set the waiting cycles of the instructions to a variant that can considerably affect the outcome of matches.\f
.TP
\fB-delayed\fP
\f This option set the execution of the instructions at the end of their cycles.\f
.TP
\fB-dump <num_cycle>\fP
\f Dump memory after nbr_cycle of execution (if the game is not already finished) in 32 bytes per line in hexadecimal code format xx. Once the memory dumped, the game ends.\f
.SH FILE_OPTIONS
These options affect only the parameters of a single champion:
.TP
\fB-n <prog_number>\fP
\f Sets the number of the next program. By default it chooses the first available number in the order of parameters.\f
.TP
\fB-a <load_adress>\fP
\f Sets the load address of the next program. When no address is specified, the addresses will be chosen so that the programs are the farthest. The addresses are modulo MEM_SIZE.\f

.SH AUTHOR
Written by Mathis Dupuy, Léo Duquesnel, Stéphane Gleizes, and Romain Gros.

.SH REPORTING BUGS
Report corewar bugs to mathis.dupuy@epitech.eu, leo.duquesnel@epitech.eu, stephane.gleizes@epitech.eu, romain.gros@epitech.eu
.SH LICENCE
Copyright © 2011 by Mathis Dupuy, Léo Duquesnel, Stéphane Gleizes, Romain Gros.
.br
This software is released under the HOV (High Ovulation Veridic).
